package ronglei.day01.demo08Static;

public class Student {
    private  int id; //学号
    private  String name;//姓名
    private  int age;//年龄
    static  String room;//所在教室
    public static int idCounter =0;

    public Student(){
        this.id= ++idCounter;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        this.id =++idCounter;
    }
}
